<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script>
			class Animal{
				constructor(name,age)
				{
					this.name=name;
					this.age=age;
				}
				selfIntro()
				{
					return "名字叫"+this.name+"年龄是"+this.age;
				}
			}
			class Dog extends Animal
			{
				constructor(name,age,type)
				{
					super(name,age);
					this.type=type;
				}
				selfIntro()
				{
					return super.selfIntro()+",品种是"+this.type;
				}
				catchAnimal(n)
				{
					return this.name+"抓住了一只"+n;
				}
			}
			var d=new Dog("大黄",4,"中华田园犬");
			var s1=d.selfIntro();
			alert(s1);
			var s2=d.catchAnimal("老干部");
			alert(s2);
		</script>
	</head>
	<body>
	</body>
</html>
